package com.wondersgroup.insurance.dnuilearn.recyclerview.swipe;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import com.wondersgroup.insurance.dnuilearn.recyclerview.swipe.extend.ItemTouchHelper;
import com.wondersgroup.insurance.dnuilearn.recyclerview.swipe.extend.ItemTouchHelper1;
import com.wondersgroup.insurance.dnuilearn.recyclerview.swipe.extend.MessageTouchItemCallBack2;

//import android.support.v7.widget.helper.ItemTouchHelper;

/**
 * Created by Administrator on 2017/6/28.
 */

public class QQRectclerActivity extends AppCompatActivity {
    RecyclerView recyclerView;
    private ItemTouchHelper itemTouchHelper;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        recyclerView = new RecyclerView(this);
        recyclerView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
//        QQMessageAdapter adapter = new QQMessageAdapter(DataUtils1.init());
        QQMessageAdapter1 adapter= new QQMessageAdapter1(DataUtils1.init());

        recyclerView.setHasFixedSize(true);
        recyclerView.setAdapter(adapter);
        setContentView(recyclerView);
        recyclerView.addItemDecoration(new MyItemDecorder());

        itemTouchHelper = new ItemTouchHelper(new MessageTouchItemCallBack2(adapter) );
        itemTouchHelper.attachToRecyclerView(recyclerView);

    }



}
